/**
 *  一句话思路：
    算法描述：
    解决所需数据结构+算法：
**/
#include<iostream>
#include<cstring>
using namespace std;
int a[110][100], n;
int dx[6] = {0,0,1,1,-1,-1};
int dy[6] = {1,-1,0,-1,0,1};
bool flaga , flagb;

void dfsa(int x, int y) {//jimmy
    if(flaga)   return ;
    if(x == n) {
        cout << "Jimmy" << endl;
        flaga = true;
        return;
    }
    for(int i=0; i<6; i++) {
        int xx = x + dx[i];
        int yy = y + dy[i];
        if(a[xx][yy] == 1) {
            a[x][y] = 0;
            dfsa(xx, yy);
            a[x][y] = 1;
        }
    }
}

void dfsb(int x, int y) {
    if(flagb) return;
    if(y == n)  {
        cout << "Chen" << endl;
        flagb = true;
        return ;
    }
    for(int i=0; i<6; i++) {
        int xx = x + dx[i];
        int yy = y + dy[i];
        // cout << "xx: " << xx << "   yy: " << yy << endl;
        // printf("a[%d][%d] = %d \n", xx, yy, a[xx][yy]);
        if(a[xx][yy] == -1) {
            a[x][y] = 0;
            dfsb(xx, yy);
            a[x][y] = -1;
        }
    }
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        cin >> n;
        flaga = flagb = false;
        int sta = 0, stb = 0;
        for(int i=1; i<=n; i++)
            for(int j=1; j<=n; j++) {
                int op;
                cin >> op;
                a[i][j] = op;
                if(i==1 && op==1)   sta = j;
                if(j==1 && op==-1)  stb = i;
            }
        dfsa(1, sta);
        dfsb(stb, 1);
        // cout << sta << "   |||   " << stb << endl;
        if(!flaga && !flagb)    cout << "yet" << endl;
    }
    return 0;
}